USE [SRD]
GO

/****** Object:  Table [dbo].[EMPRESA]    Script Date: 05/15/2011 14:24:50 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

CREATE TABLE [dbo].[EMPRESA](
	[EMPRESA_ID] [int] IDENTITY(1,1) NOT NULL,
	[RASAO_SOCIAL] [nvarchar](60) NOT NULL,
	[NOME_FANTASIA] [nvarchar](50) NOT NULL,
	[CNPJ] [nvarchar](14) NOT NULL,
	[EMAIL] [nvarchar](50) NOT NULL,
	[CEP] [nvarchar](8) NOT NULL,
	[LOUGRADOURO] [nvarchar](50) NOT NULL,
	[NUMERO] [nvarchar](10) NOT NULL,
	[COMPLEMENTO] [nvarchar](30),
	[CIDADE] [nvarchar](30) NOT NULL,
	[ESTADO] [nvarchar](2) NOT NULL,
	[TELEFONE] [nvarchar](10) NOT NULL,
	[FAX] [nvarchar](10),
	[END_SMTP] [nvarchar](50) NULL,
	[USER_SMTP] [nvarchar](50) NULL,
	[SENHA_SMTP] [nvarchar](20) NULL,
 CONSTRAINT [PK_EMPRESA] PRIMARY KEY CLUSTERED 
(
	[EMPRESA_ID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]

GO

ALTER TABLE [dbo].[EMPRESA]  WITH CHECK ADD  CONSTRAINT [FK_EMPRESA_ENDERECO_EMPRESA] FOREIGN KEY([ENDERECO_EMPRESA_ID])
REFERENCES [dbo].[ENDERECO_EMPRESA] ([ENDERECO_EMPRESA_ID])
GO

ALTER TABLE [dbo].[EMPRESA] CHECK CONSTRAINT [FK_EMPRESA_ENDERECO_EMPRESA]
GO


